package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {
    void addBrandAndCategory(@Param("bid") Long id, @Param("cids") List<Long> cids);

    @Select("SELECT b.*  " +
            "FROM tb_brand b, tb_category_brand cb " +
            "WHERE b.id=cb.brand_id AND cb.category_id=#{cid} ")
    List<Brand> findByCategoryId(Long cid);
}
